#pragma once
#include <windows.h>

void SendMouseLeftClick(HWND hwndTarget, int x, int y)
{
    // 发送鼠标左键按下消息
    SendMessage(hwndTarget, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y));
    // 发送鼠标左键松开消息，完成左键单击操作
    SendMessage(hwndTarget, WM_LBUTTONUP,0, MAKELPARAM(x, y));
}


void SendMouseRightClick(HWND hwndTarget, int x, int y)
{
    // 发送鼠标右键按下消息
    SendMessage(hwndTarget, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(x, y));
    // 发送鼠标右键松开消息，完成右键单击操作
    SendMessage(hwndTarget, WM_RBUTTONUP, 0,  MAKELPARAM(x, y));
}